package kr.co.fashionmai.dao;

import java.util.List;

import kr.co.fashionmai.vo.Member;
import kr.co.fashionmai.vo.OrderSheet;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class FrontDao extends SqlMapClientDaoSupport
{
	
	public Member checkLogion(Member member)
	{	
		return (Member) getSqlMapClientTemplate().queryForObject("front.memberCheck", member);
	}
	
	public List<OrderSheet> getOrderSheetList(OrderSheet orderSheet)
	{
		return getSqlMapClientTemplate().queryForList("front.orderSheet", orderSheet);
	}
	
	public int getTotalCount(OrderSheet orderSheet)
	{
		return (Integer) getSqlMapClientTemplate().queryForObject("front.totalCount",orderSheet);
	}
	
	public boolean insert(OrderSheet orderSheet)
	{
		try
		{
			getSqlMapClientTemplate().insert("front.insert",orderSheet);
		}
		catch(Exception e)
		{
			return false;
		}
		return true;
	}
	
	public boolean delete(String titleNo)
	{
		try
		{
			getSqlMapClientTemplate().delete("front.delete",titleNo);
		}
		catch(Exception e)
		{
			return false;
		}
		return true;
	}
	
	public OrderSheet updateSelect(String titleNo)
	{
		return (OrderSheet) getSqlMapClientTemplate().queryForObject("front.updateSelect",titleNo);
	}
	
	public OrderSheet select(String titleNo)
	{
		return (OrderSheet)getSqlMapClientTemplate().queryForObject("front.select",titleNo);
	}
	
	public String titleCheck(String titleNo)
	{
		return (String) getSqlMapClientTemplate().queryForObject("front.titleCheck",titleNo);
	}
}
